<?php
/**
 * 
 */
require_once 'Zend/Sql/Adapter/Standard/Clause/Abstract.php';
require_once 'Zend/Sql/Adapter/Standard/Expression/Abstract.php';
require_once 'Zend/Sql/Adapter/Standard/Statement/Abstract.php';

/**
 * 
 * @author MARIA
 *
 */
class Zend_Sql_Adapter_Standard_Clause_Where
	extends Zend_Sql_Adapter_Standard_Clause_Abstract
{
	/**
	 * 
	 * @var Zend_Sql_Adapter_Standard_Expression_Abstract
	 */
	protected $expression;
	
	/**
	 * @return the $expression
	 */
	public function getExpression() {
		return $this->expression;
	}

	/**
	 * @param Zend_Sql_Adapter_Standard_Expression_Identifier_Table|Zend_Sql_Adapter_Standard_Statement $expression
	 */
	public function setExpression($expression) {
		$this->expression = $expression;
	}

	public function __construct($expression=null) {
		if ( ! $expression instanceof Zend_Sql_Adapter_Standard_Expression_Abstract &&
			 ! $expression instanceof Zend_Sql_Adapter_Standard_Statement_Abstract
			) {
			require_once 'Zend/Sql/Exception.php';
			throw new Zend_Sql_Exception('Invalide type');
		}
		if ($expression) {
			$this->setExpression($expression);
		}
	}
	
	public function toString() {
		return 'WHERE ';// . $this->expression->toString();
	}
}
